state_hash = {
	"Connecticut" => "CT",
	"Delaware" => "DE",
	"New Jersey" => "NJ",
	"Virginia" => "VA"
}

print "Enter the name of a state:"
state = gets.chomp
abbr = state_hash[state]
puts "The abbreviation is #{abbr}"
#强势合并
h1 = {"Smith" => "John","Jones" => "Jans"}
h2 = {"Smith" => "Jim"}
h1.update(h2)
puts h1["Smith"]
#弱势合并
h1 = {"Smith" => "John","Jones" => "Jans"}
h2 = {"Smith" => "Jim"}
h3 = h1.merge(h2)
puts h1["Smith"]
puts h3["Smith"]

h = Hash[1,2,3,4,5,6]
puts h.select {|k,v| k > 1}
puts h.reject {|k,v| k > 1}

puts h.invert
